-
Notifications
You must be signed in to change notification settings - Fork 572
fix(litellm): fix gen_ai.request.messages to be as expected
#5255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(litellm): fix gen_ai.request.messages to be as expected
#5255
Conversation
…inal messages and handle data URLs correctly
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Litellm
Other
Documentation 📚
Internal Changes 🔧Release
Other
🤖 This preview updates automatically when you update the PR. |
| if item.get("type") == "image_url": | ||
| image_url = item.get("image_url") or {} | ||
| url = image_url.get("url", "") | ||
| if url.startswith("data:") and ";base64," in url: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Case-sensitive base64 check bypasses blob detection and redaction
Low Severity
The check ";base64," in url is case-sensitive, but per RFC 2397 the base64 token in data URIs is case-insensitive. Data URIs with uppercase variants like data:image/png;BASE64,... would not be recognized as base64 data URIs, causing them to be converted to type: "uri" instead of type: "blob". Since redact_blob_message_parts only redacts blob types, these inline base64 data URIs would not be redacted, potentially exposing sensitive image data in telemetry.
Issues
Closes https://linear.app/getsentry/issue/TET-1635/redact-images-litellm